package com.haohan.jingyuan.customer.helper;

import com.haohan.jingyuan.customer.dto.resp.IncomeTypeInfoResp;
import com.haohan.jingyuan.customer.entity.CustomerIncomeType;

/**
 * 收入类型响应对象转换工具类
 * 
 * @ClassName IncomeTypeRespHelper
 * @Description 收入类型响应对象转换工具
 * @Author hexijun
 * @Time 2025/01/19 17:00
 * @Version 1.0
 */
public class IncomeTypeRespHelper {

    /**
     * 将收入类型实体转换为收入类型信息响应对象
     * 
     * @param customerIncomeType 收入类型实体
     * @return 收入类型信息响应对象
     */
    public static IncomeTypeInfoResp convert2IncomeTypeInfoResp(CustomerIncomeType customerIncomeType) {
        if (customerIncomeType == null) {
            return null;
        }

        IncomeTypeInfoResp incomeTypeInfoResp = new IncomeTypeInfoResp();
        incomeTypeInfoResp.setId(customerIncomeType.getId());
        incomeTypeInfoResp.setType(customerIncomeType.getType());
        incomeTypeInfoResp.setTypeName(customerIncomeType.getTypeName());
        incomeTypeInfoResp.setDescription(customerIncomeType.getDescription());
        incomeTypeInfoResp.setCreator(customerIncomeType.getCreator());
        incomeTypeInfoResp.setGmtCreated(customerIncomeType.getGmtCreated());
        incomeTypeInfoResp.setModifier(customerIncomeType.getModifier());
        incomeTypeInfoResp.setGmtModified(customerIncomeType.getGmtModified());

        return incomeTypeInfoResp;
    }
}
